package com.bds.btcdc.util;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

@Configuration
public class Const {
	@Autowired
	Environment environment;
	public static int FAIL_400 = 400;
	public static int FAIL_500 = 500;
	public static int FAIL = 999;
	public static int SUC = 200;
	public static final String DESKEY = "12345abc";
	//BigDecimal除法,小数点保留位数
	public static final Integer BDM_SCALE=6;
	public static final boolean LOCAL=true;
	public static class GATEIO {
		public static final String EXCHANGE = "GATEIO";
		public final static String MARKET_TOPIC = "/topic/gateio/marketInfo";
		public static final String URL = "http://data.gateio.io";
		public static final String SKEY = "3cc75ccda1e8c1310da65313b05467b3215913d789773dfe8866aba1043909b3";
		public static final String AKEY = "A21E3D10-5423-4A58-BD1F-728A7089871F";
	}

	public static class OKCOIN {
		public static final String EXCHANGE = "OKCOIN";
		public static final String WS_URL = "wss://real.okcoin.cn:10440/websocket";
		public static final String URL = "https://api.huobipro.com";
		public final static String MARKET_TOPIC = "/topic/okcoin/marketInfo";
		private static String AKey = "0ee7c9e9-081c-41d9-a66e-3ee151cb3cb6";
		private static String SKey = "2B7AA565D45EE4D5987F7927CEBB6A98";
	}

	public static class HUOBI {
		public static final String EXCHANGE = "HUOBI";
		public static final String URL = "https://api.huobipro.com";
		public static final String WS_URL = "wss://api.huobipro.com/ws";
		public static final String MARKET_TOPIC = "/topic/huobi/marketInfo";
		public static final String DEPTH_TOPIC = "/topic/huobi/marketDepth";
		public static final String WS_MARKET_INFO = "/market/detail/merged";
	}

	public static class OKEX {
		public static final String EXCHANGE = "OKEX";
		public static final String WS_URL = "wss://real.okex.com:10440/websocket/okexapi";
		public static final String MARKET_TOPIC = "/topic/okex/marketInfo";
	}

	public static class ZB {
		public static final String EXCHANGE = "ZB";
		public static final String WS_URL = "wss://api.zb.com:9999/websocket";
		public final static String MARKET_TOPIC = "/topic/zb/marketInfo";
		public static final String DEPTH_TOPIC = "/topic/zb/marketDepth";
		public static final String RECORD_TOPIC = "/topic/zb/record";
	}

	public static class BITSTAMP {
		public static final String EXCHANGE = "BITSTAMP";
		public static final String URL = "https://www.bitstamp.net/api/v2/";
		public final static String MARKET_TOPIC = "/topic/bitstamp/marketInfo";
	}

	public static Integer RE_CONN_TIME = 10 * 1000;// 网络异常，重新连接间隔 ms
	public static String WS_URL;
	public static String ZK_URL;

	public static String END_WITH_COUNT="#0.000";//资产情况 金额小数点

	@PostConstruct
	public void doStart() {
		String wsurl = environment.getProperty("ws.url");
	

		Const.WS_URL = wsurl + "/market_info";
		
	}

}
